<template>
  <div class="app-container">
    <el-card>
      <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="80px" class="searchtop">
        <el-form-item label="信件主题">
          <el-input style="width: 100%;" v-model="queryParams.theme" placeholder="请输入信件主题" clearable
            @keyup.enter="handleQuery" />
          <!-- <el-select style="width: 100%;" v-model="queryParams.theme" placeholder="请选择信件主题" clearable>
            <el-option v-for="dict in theme" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select> -->
        </el-form-item><el-form-item label="信件编号">
          <el-input style="width: 100%;" v-model="queryParams.id" placeholder="请输入信件编号" clearable
            @keyup.enter="handleQuery" />
          <!-- <el-select style="width: 100%;" v-model="queryParams.theme" placeholder="请选择信件主题" clearable>
            <el-option v-for="dict in theme" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select> -->
        </el-form-item>
        <!-- <el-form-item label="处理状态">
          <el-select style="width: 100%;" v-model="queryParams.status" placeholder="请选择处理状态" clearable>
            <el-option v-for="dict in message_status" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item> -->
        <el-form-item label="提交时间" style="width: 308px;">
          <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-"
            start-placeholder="开始日期" end-placeholder="结束日期"
            :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
        </el-form-item>
        <!-- <el-form-item label="提交时间">
          <el-date-picker style="width: 100%;" v-model="daterangeAllocationTime" value-format="YYYY-MM-DD HH:mm:ss"
            type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
            :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
        </el-form-item> -->
        <!-- <el-form-item label="处理部门" v-if="letterDeal=='信件分配'" prop="deptId">
          <el-tree-select @change="sel" v-model="deptId" :data="deptList"
            :props="{ value: 'deptId', label: 'deptName', children: 'children' }" value-key="deptId"
            placeholder="选择信件处理部门" check-strictly />
        </el-form-item> -->
        <el-form-item label="处理部门" prop="deptName">
          <el-tree-select v-model="queryParams.deptId" :data="deptList"
            :props="{ value: 'deptId', label: 'deptName', children: 'children' }" value-key="deptId"
            placeholder="选择信件处理部门" check-strictly />
          <!-- <el-input style="width: 100%;" v-model="queryParams.deptName" placeholder="请输入分配部门" clearable
            @keyup.enter="handleQuery" /> -->
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>

    <el-card class="mt20">

      <el-row :gutter="10" class="mb8" type="flex" justify="space-between">
        <!-- <el-col :span="6"><span style="font-size: large">信件管理</span></el-col> -->
        <el-col :span="1.5">
          <div class="top_tab">
            <div @click="tabs(3)" :class="tab==3?'aaa1':'bbb1'">全部</div>
            <div @click="tabs(0)" :class="tab==0?'aaa1':'bbb1'">待处理</div>
            <div @click="tabs(1)" :class="tab==1?'aaa1':'bbb1'">处理中</div>
            <div @click="tabs(2)" :class="tab==2?'aaa1':'bbb1'">已处理</div>
          </div>
        </el-col>
        <el-col :span="1.5">
          <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
            v-hasPermi="['system:message:remove']">批量删除</el-button>
          <el-button type="warning" plain icon="Download" @click="handleExport"
            v-hasPermi="['wms:message:export']">导出</el-button>
        </el-col>
      </el-row>

      <el-table v-loading="loading" :data="messageList" border class="mt20" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column type="index" width="60" align="center" label="序号" fixed="left" />
        <el-table-column label="信件编号" prop="id" align="center" />
        <el-table-column label="信件状态" prop="status" width="90" align="center">
          <template #default="scope">
            <dict-tag :options="message_status" :value="scope.row.status" />
          </template>
        </el-table-column>
        <el-table-column label="姓名" prop="name" align="center" />
        <el-table-column label="性别" prop="gender" width="70" align="center">
          <template #default="scope">
            <dict-tag :options="sys_user_sex" :value="scope.row.gender" />
          </template>
        </el-table-column>

        <!-- <el-table-column label="填写地内容" prop="addressValue" align="center" /> -->

        <el-table-column label="户籍所在地" prop="domicileAddress" align="center" />
        <el-table-column label="手机号" prop="phone" align="center" />

        <el-table-column label="信件主题" prop="theme" align="center" />
        <el-table-column label="操作" width="200px" align="center" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
              v-hasPermi="['wms:message:edit']">查看</el-button>
            <el-button link type="primary" v-if="!scope.row.deptId&&scope.row.status==0" icon="Share"
              @click="allocation(scope.row)" v-hasPermi="['wms:message:share']">信件分配</el-button>
            <el-button link type="primary" v-if="!scope.row.deptFeedback&&scope.row.status==1" icon="Message"
              @click="handle(scope.row)" v-hasPermi="['wms:message:handle']">信件处理</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-row>
        <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
          v-model:limit="queryParams.pageSize" @pagination="getList" />
      </el-row>

    </el-card>
    <!-- 添加或修改信件管理对话框 -->
    <el-drawer title="查看信件详情" v-model="open" size="60%" append-to-body>
      <el-form ref="messageRef" :model="form" :rules="rules" label-width="90px">
        <div class="tablist">
          <div @click="st1=1" :class="st1==1?'aaa':'bbb'">基本信息</div>
          <div @click="st1=2" v-if="form.status==2" :class="st1==2?'aaa':'bbb'" style="margin-left: 20px;">处理信息</div>
        </div>
        <div class="searchtop1" style="margin-top: 20px;" v-if="st1==1">
          <el-form-item label="用户姓名">
            <el-input disabled style="width: 100%;" v-model="form.name" placeholder="请输入姓名" />
          </el-form-item>

          <el-form-item label="用户性别">
            <el-select disabled style="width: 100%;" v-model="form.gender" placeholder="请选择性别">
              <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label"
                :value="parseInt(dict.value)"></el-option>
            </el-select>
          </el-form-item>

          <!-- <el-form-item label="填写地内容">
            <el-input disabled style="width: 100%;" v-model="form.addressValue" placeholder="请输入填写地内容" />
          </el-form-item> -->

          <el-form-item label="户籍所在地">
            <el-input disabled style="width: 100%;" v-model="form.domicileAddress" placeholder="请输入户籍所在地" />
          </el-form-item>
          <el-form-item label="手机号">
            <el-input disabled style="width: 100%;" v-model="form.phone" placeholder="请输入手机号" />
          </el-form-item>
          <el-form-item label="邮箱">
            <el-input v-if="form.email" disabled style="width: 100%;" v-model="form.email" placeholder="请输入邮箱" />
            <div v-else>--</div>
          </el-form-item>

          <el-form-item label="主题">
            <el-input disabled style="width: 100%;" v-model="form.theme" placeholder="请输入主题" />
          </el-form-item>

          <el-form-item label="信件状态">
            <el-select disabled style="width: 100%;" v-model="form.status" placeholder="请选择信件状态">
              <el-option v-for="dict in message_status" :key="dict.value" :label="dict.label"
                :value="dict.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="照片" style="width: 100%;">

            <el-image v-if="form.image" v-for="(item,index) in imgurl" :key="index" :src="item.url"
              style="width: 80px;height: 80px;object-fit: contain;margin-left: 10px;border-radius: 10px;"
              :preview-src-list="srcList" @click="addpreviewImg(item.url)"></el-image>

            <div v-if="form.image==''">--</div>


          </el-form-item>
          <el-form-item label="视频" style="width: 100%;">
            <video controls v-if="videourl" style="width: 400px;height: 200px;">
              <source :src="videourl"  type="video/mp4">
              <source :src="videourl"  type="video/webm">
              <source :src="videourl"  type="video/ogg"> 您的浏览器不支持video标签。
            </video>
            <!-- <video controls v-if="videourl" :src="videourl" style="width: 400px;height: 200px;"></video> -->
            <div v-else>--</div>

          </el-form-item>
          <el-form-item label="内容" style="width: 100%;">
            <el-input disabled v-model="form.content" placeholder="请输入内容" style="width:100%" :rows="4"
              type="textarea" />


          </el-form-item>
        </div>
        <div class="searchtop1" style="margin-top: 20px;" v-if="st1==2">

          <el-form-item label="分配部门">
            <el-input disabled style="width: 100%;" v-model="form.deptName" placeholder="请输入分配部门" />
          </el-form-item>

          <el-form-item label="反馈内容" style="width: 100%;">
            <el-input disabled style="width: 100%;" v-model="form.deptFeedback" type="textarea" placeholder="请输入内容" />
          </el-form-item>

          <el-form-item label="反馈附件" style="width: 100%;">
            <a v-if="fileurl" style="color: #409EFF;" :href="fileurl" target="_blank">反馈附件</a>
            <div v-else>--</div>
          </el-form-item>
        </div>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-drawer>
    <el-drawer :title="letterDeal" v-model="openHandle" size="70%" append-to-body>
      <el-form ref="messageRef" :model="formHandle" :rules="rules" label-width="100px">
        <div class="searchtop2">
          <el-form-item label="处理部门" style="width: 100%;">
            <el-input style="width: 100%;" disabled v-model="formHandle.deptName" placeholder="请输入处理部门" />
          </el-form-item><el-form-item label="写信人姓名">
            <el-input style="width: 100%;" disabled v-model="formHandle.name" placeholder="请输入姓名" />
          </el-form-item>
          <el-form-item label="写信人性别">
            <el-select style="width: 100%;" disabled v-model="formHandle.gender" placeholder="请选择性别">
              <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label"
                :value="parseInt(dict.value)"></el-option>
            </el-select>
          </el-form-item>
          <!-- <el-form-item label="填写地内容">
            <el-input style="width: 100%;" disabled v-model="formHandle.addressValue" placeholder="请输入填写地内容" />
          </el-form-item> -->
          <el-form-item label="户籍所在地">
            <el-input style="width: 100%;" disabled v-model="formHandle.domicileAddress" placeholder="请输入户籍所在地" />
          </el-form-item>
          <el-form-item label="写信人手机号">
            <el-input style="width: 100%;" disabled v-model="formHandle.phone" placeholder="请输入手机号" />
          </el-form-item>
          <el-form-item label="写信人邮箱">
            <el-input v-if="formHandle.email" disabled style="width: 100%;" v-model="formHandle.email"
              placeholder="请输入邮箱" />
            <div v-else>--</div>
          </el-form-item>
          <el-form-item label="主题">
            <el-input v-model="formHandle.theme" disabled placeholder="" style="width:100%" />

          </el-form-item>
          <el-form-item label="信件内容" style="width: 100%;">
            <el-input disabled v-model="formHandle.content" placeholder="" style="width:100%" :rows="5"
              type="textarea" />
          </el-form-item>
          <el-form-item label="照片" style="width: 100%;">
            <div>
              <el-image v-if="formHandle.image" v-for="(item,index) in imgurl" :key="index" :src="item.url"
                style="width: 80px;height: 80px;object-fit: contain;margin-left: 10px;border-radius: 10px;"
                :preview-src-list="srcList" @click="addpreviewImg(item.url)"></el-image>

              <div v-if="formHandle.image==''">--</div>

            </div>

          </el-form-item>
          <el-form-item label="视频" style="width: 100%;">
            <video controls v-if="videourl" >
              <source :src="videourl"  type="video/mp4">
              <source :src="videourl"  type="video/webm">
              <source :src="videourl"  type="video/ogg"> 您的浏览器不支持video标签。
            </video>
            <!-- <video v-if="videourl" controls :src="videourl" style="width: 300px;height: 200px;"></video> -->
            <div v-else>--</div>

          </el-form-item>

          <el-divider border-style="dashed" />

          <el-form-item label="处理部门" v-if="letterDeal=='信件分配'" prop="deptId">
            <el-tree-select @change="sel" v-model="deptId" :data="deptList"
              :props="{ value: 'deptId', label: 'deptName', children: 'children' }" value-key="deptId"
              placeholder="选择信件处理部门" check-strictly />
          </el-form-item>
          <el-form-item label="反馈内容" v-if="letterDeal=='信件处理'" style="width:100%">
            <el-input v-model="del.deptFeedback" placeholder="请输入反馈内容" style="width:100%" :rows="4" type="textarea" />
          </el-form-item>
          <el-form-item label="反馈附件" style="width: 100%;" v-if="letterDeal=='信件处理'">
            <file-upload v-model="del.deptEnclosureImage" />
          </el-form-item>
        </div>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" v-if="letterDeal=='信件处理'" @click="submitH">处 理</el-button>
          <el-button :loading="buttonLoading" type="primary" v-if="letterDeal=='信件分配'" @click="submitS">分 配</el-button>
          <el-button @click="openHandle= false;">取 消</el-button>
        </div>
      </template>
    </el-drawer>
  </div>
</template>

<script setup name="Message">
  import {
    listMessage,
    getMessage,
    delMessage,
    addMessage,
    share1,
    handle1,
    updateMessage
  } from "@/api/wms/message";
  import {
    listByIds
  } from "@/api/system/oss";
  import {

    listDept,
    getDept,
    delDept,
    addDept,
    updateDept,
    listDeptExcludeChild
  } from "@/api/system/dept";
  const {
    proxy
  } = getCurrentInstance();
  const {
    message_status,
    sys_user_sex,
    theme
  } = proxy.useDict('message_status', 'sys_user_sex', 'theme');
  const deptList = ref([]);
  const srcList = ref(['1']);
  const arr1 = ref([]);
  const messageList = ref([]);
  const dateRange = ref([]);
  const imgurl = ref([]);
  const open = ref(false);
  const openHandle = ref(false);
  const buttonLoading = ref(false);
  const multiple = ref(true);
  const loading = ref(true);
  const ids = ref([]);
  const deptList1 = ref([]);
  const single = ref(true);
  const total = ref(0);
  const title = ref("");
  const letterDeal = ref("");

  const data = reactive({
    fileurl: undefined,
    videourl: '',
    del: {},
    deptId: undefined,
    deptName: undefined,
    formHandle: {},
    form: {},
    tab: 3,
    st1: 1,
    queryParams: {
      pageNum: 1,
      pageSize: 10,
      name: undefined,
      authorId: undefined,
      gender: undefined,
      address: undefined,
      addressValue: undefined,
      addressIds: undefined,
      domicileAddress: undefined,
      phone: undefined,
      email: undefined,
      theme: undefined,
      content: undefined,
      image: undefined,
      video: undefined,

      userId: undefined,
      deptId: undefined,
      deptName: undefined,
      deptFeedback: undefined,
      deptEnclosureImage: undefined,
      deptEnclosureVideo: undefined,
      reply: undefined,
      replyName: undefined
    },
    rules: {
      id: [{
        required: true,
        message: "不能为空",
        trigger: "blur"
      }],
      name: [{
        required: true,
        message: "姓名不能为空",
        trigger: "blur"
      }],
      authorId: [{
        required: true,
        message: "写信人id不能为空",
        trigger: "blur"
      }],
      gender: [{
        required: true,
        message: "性别不能为空",
        trigger: "change"
      }],
      address: [{
        required: true,
        message: "填写地唯一id不能为空",
        trigger: "blur"
      }],
      addressValue: [{
        required: true,
        message: "填写地内容不能为空",
        trigger: "blur"
      }],
      addressIds: [{
        required: true,
        message: "填写地id不能为空",
        trigger: "blur"
      }],
      domicileAddress: [{
        required: true,
        message: "户籍所在地不能为空",
        trigger: "blur"
      }],
      phone: [{
        required: true,
        message: "手机号不能为空",
        trigger: "blur"
      }],
      email: [{
        required: true,
        message: "邮箱不能为空",
        trigger: "blur"
      }],
      theme: [{
        required: true,
        message: "主题不能为空",
        trigger: "blur"
      }],
      content: [{
        required: true,
        message: "内容不能为空",
        trigger: "blur"
      }],
      image: [{
        required: true,
        message: "照片不能为空",
        trigger: "blur"
      }],
      video: [{
        required: true,
        message: "视频不能为空",
        trigger: "blur"
      }],
      status: [{
        required: true,
        message: "信件状态不能为空",
        trigger: "change"
      }],
      userId: [{
        required: true,
        message: "分配用户不能为空",
        trigger: "blur"
      }],
      deptId: [{
        required: true,
        message: "分配部门不能为空",
        trigger: "blur"
      }],
      deptName: [{
        required: true,
        message: "分配部门不能为空",
        trigger: "blur"
      }],
      deptFeedback: [{
        required: true,
        message: "反馈内容不能为空",
        trigger: "blur"
      }],
      deptEnclosureImage: [{
        required: true,
        message: "反馈附件不能为空",
        trigger: "blur"
      }],
      deptEnclosureVideo: [{
        required: true,
        message: "反馈附件不能为空",
        trigger: "blur"
      }],
      reply: [{
        required: true,
        message: "回复人id不能为空",
        trigger: "blur"
      }],
      replyName: [{
        required: true,
        message: "回复人姓名不能为空",
        trigger: "blur"
      }]
    }
  });

  const {
    fileurl,
    videourl,
    del,
    deptName,
    deptId,
    formHandle,
    tab,
    queryParams,
    form,
    st1,
    rules
  } = toRefs(data);

  function addpreviewImg(url) {
    srcList.value = []
    srcList.value.push(url)
  }
  /** 查询信件管理列表 */
  function getList() {
    loading.value = true;
    listMessage(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
      messageList.value = response.rows;
      total.value = response.total;
      loading.value = false;
    });
  }

  function tabs(e) {
    tab.value = e
    if (e == 3) {
      delete queryParams.value.status
    } else if (e != 3) {
      queryParams.value.status = e
    }
    getList()
  }


  function getList1() {

    listDept({
      pageNum: 1,
      pageSize: 990,
    }).then(response => {
      deptList.value = proxy.handleTree(response.data, "deptId");
      deptList1.value = response.data

    });
  }



  /** 多选框选中数据 */
  function handleSelectionChange(selection) {
    ids.value = selection.map(item => item.noticeId);
    single.value = selection.length != 1;
    multiple.value = !selection.length;
  }
  // 取消按钮
  function cancel() {
    open.value = false;
    reset();
  }

  // 表单重置
  function reset() {
    form.value = {
      id: null,
      name: null,
      authorId: null,
      gender: null,
      address: null,
      addressValue: null,
      addressIds: null,
      domicileAddress: null,
      phone: null,
      email: null,
      theme: null,
      content: null,
      image: null,
      video: null,
      delFlag: null,
      createBy: null,
      createTime: null,
      updateBy: null,
      updateTime: null,
      userId: null,
      deptId: null,
      deptName: null,
      deptFeedback: null,
      deptEnclosureImage: null,
      deptEnclosureVideo: null,
      reply: null,
      replyName: null
    };
    proxy.resetForm("messageRef");
  }

  /** 搜索按钮操作 */
  function handleQuery() {
    queryParams.value.pageNum = 1;
    getList();
  }

  /** 重置按钮操作 */
  function resetQuery() {

    proxy.resetForm("queryRef");
    dateRange.value = [];
    queryParams.value.deptId = ''
    delete queryParams.value.status
    tab.value = 3
    handleQuery();
  }

  /** 新增按钮操作 */
  function handleAdd() {
    reset();
    open.value = true;
    title.value = "添加信件管理";
  }

  function submitS() {
    if (!deptId.value) {
      proxy.$modal.msgError("请选择分配部门!");
      return
    }
    for (var i = 0; i < deptList1.value.length; i++) {
      if (deptId.value == deptList1.value[i].deptId) {
        deptName.value = deptList1.value[i].deptName


      }
    }
    share1({
      deptId: deptId.value,
      deptName: deptName.value,
      id: formHandle.value.id,

    }).then(response => {
      if (response.code == 200) {
        proxy.$modal.msgSuccess("分配成功");
        openHandle.value = false;
        getList();
      } else {
        proxy.$modal.msgSuccess(response.msg);
      }

    });
  }

  function submitH() {
    console.log(del.value, "del.value")
    del.value.status = 2
    if (!del.value.deptFeedback) {
      proxy.$modal.msgError("请输入反馈内容!");
      return
    }
    handle1(del.value).then(response => {
      if (response.code == 200) {
        proxy.$modal.msgSuccess("处理成功");
        openHandle.value = false;
        getList();
      } else {
        proxy.$modal.msgSuccess(response.msg);
      }

    });

  }

  /** 分配按钮操作 */
  function allocation(row) {
    formHandle.value = {}
    const _id = row.id || ids.value
    getMessage(_id).then(response => {
      formHandle.value = response.data;
      if (response.data.video) {
        videodel(response.data.video)
      }
      if (response.data.image) {
        imgdel(response.data.image)
      }

      if (formHandle.image) {
        arr1.value = formHandle.image.split(",")
      }
      openHandle.value = true;
      letterDeal.value = '信件分配';
    });
  }

  function handle(row) {
    formHandle.value = {}
    const _id = row.id || ids.value
    getMessage(_id).then(response => {
      formHandle.value = response.data;
      if (response.data.video) {
        videodel(response.data.video)
      }
      if (response.data.image) {
        imgdel(response.data.image)
      }

      if (formHandle.image) {
        arr1.value = formHandle.image.split(",")
      }
      del.value.id = response.data.id
      openHandle.value = true;
      letterDeal.value = '信件处理';
    });
  }
  /** 修改按钮操作 */
  function handleUpdate(row) {
    reset();
    const _id = row.id || ids.value
    getMessage(_id).then(response => {
      form.value = response.data;
      console.log(response.data, "response.data")
      // if (form.value.image) {
      //   arr1.value = form.image.split(",")
      // }
      if (response.data.video) {
        videodel(response.data.video)
      }
      if (response.data.image) {
        imgdel(response.data.image)
      }
      if (response.data.deptEnclosureImage) {
        feedimgdel(response.data.deptEnclosureImage)
      }


      open.value = true;
      title.value = "修改信件管理";
    });
  }

  function videodel(video) {
    listByIds(video).then(response => {

      videourl.value = response.data[0].url

    });
  }

  function imgdel(img) {
    listByIds(img).then(response => {

      imgurl.value = response.data
      console.log(imgurl.value, " videourl.value")
    });
  }

  function feedimgdel(img) {
    listByIds(img).then(response => {

      fileurl.value = response.data[0].url

    });
  }

  /** 提交按钮 */
  function submitForm() {
    proxy.$refs["messageRef"].validate(valid => {
      if (valid) {
        buttonLoading.value = true;
        if (form.value.id != null) {
          updateMessage(form.value).then(response => {
            proxy.$modal.msgSuccess("修改成功");
            open.value = false;
            getList();
          }).finally(() => {
            buttonLoading.value = false;
          });
        } else {
          addMessage(form.value).then(response => {
            proxy.$modal.msgSuccess("新增成功");
            open.value = false;
            getList();
          }).finally(() => {
            buttonLoading.value = false;
          });
        }
      }
    });
  }

  /** 删除按钮操作 */
  function handleDelete(row) {
    const _ids = row.id || ids.value;
    proxy.$modal.confirm('是否确认删除信件管理编号为"' + _ids + '"的数据项？').then(function() {
      loading.value = true;
      return delMessage(_ids);
    }).then(() => {
      loading.value = true;
      getList();
      proxy.$modal.msgSuccess("删除成功");
    }).catch(() => {}).finally(() => {
      loading.value = false;
    });
  }

  /** 导出按钮操作 */
  function handleExport() {
    proxy.download('wms/message/export', {
      ...queryParams.value
    }, `message_${new Date().getTime()}.xlsx`)
  }

  getList1();
  getList();
</script>
<style scoped>
  .searchtop {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  .searchtop .el-form-item {
    width: 18%;
  }

  .searchtop1 {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  .searchtop1 .el-form-item {
    width: 50%;
  }

  .searchtop2 {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  .searchtop2 .el-form-item {
    width: 33%;
  }

  .top_tab {
    display: flex;

    z-index: 99999;
  }

  .top_tab>div {
    width: 100px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
  }

  .aaa1 {

    background: #2994FF;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.03), 0px 1px 6px -1px rgba(0, 0, 0, 0.02), 0px 2px 4px 0px rgba(0, 0, 0, 0.02);
    border-radius: 2px;
    border: 0px solid rgba(0, 0, 0, 0.88);

    font-weight: bold;
    font-size: 14px;
    color: #FFFFFF;


    font-style: normal;
  }

  .bbb1 {
    font-weight: bold;
    background: #AEB8C3;
    border-radius: 2px;
    font-size: 14px;
    color: #FFFFFF;
  }

  .tablist {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    margin-top: 10px;
  }

  .aaa {
    color: #409EFF;
    padding-bottom: 4px;
    border-bottom: 2px solid #409EFF;
  }

  .bbb {

    padding-bottom: 4px;
    border-bottom: 2px;
  }
</style>
